import request from '@/utils/request'

// 查询指令列表
export function listCommand(query) {
  return request({
    url: '/system/command/list',
    method: 'get',
    params: query
  })
}

// 查询指令详细
export function getCommand(id) {
  return request({
    url: '/system/command/' + id,
    method: 'get'
  })
}

// add指令
export function addCommand(data) {
  return request({
    url: '/system/command',
    method: 'post',
    data: data
  })
}

// edit指令
export function updateCommand(data) {
  return request({
    url: '/system/command',
    method: 'put',
    data: data
  })
}

// delete指令
export function delCommand(id) {
  return request({
    url: '/system/command/' + id,
    method: 'delete'
  })
}

// 类目开关类型默认指令列表
export function categorycommandlist(query) {
  return request({
    url: '/system/categorycommand/list',
    method: 'get',
    params: query
  })
}

// 类目开关类型默认指令添加
export function categorycommand(data) {
  return request({
    url: '/system/categorycommand',
    method: 'post',
    data: data
  })
}

// 类目开关类型默认指令edit
export function updateCategorycommand(data) {
  return request({
    url: '/system/categorycommand',
    method: 'put',
    data: data
  })
}

// 设备开关类型指令
export function devicecommand(data) {
  return request({
    url: '/system/devicecommand',
    method: 'post',
    data: data
  })
}

// 类目开关类型默认指令列表
export function devicecommandlist(query) {
  return request({
    url: '/system/devicecommand/list',
    method: 'get',
    params: query
  })
}

// 类目开关类型默认指令edit
export function updateDevicecommand(data) {
  return request({
    url: '/system/devicecommand',
    method: 'put',
    data: data
  })
}
